<?php
$labels = array(
	'name' => _x('Front Front Page Gallery', 'post type general name', 'your_text_domain'),
	'singular_name' => _x('Front Page Gallery', 'post type singular name', 'your_text_domain'),
	'add_new' => _x('Add New', 'Front Page Gallery', 'your_text_domain'),
	'add_new_item' => __('Add New Front Page Gallery', 'your_text_domain'),
	'edit_item' => __('Edit Front Page Gallery', 'your_text_domain'),
	'new_item' => __('New Front Page Gallery', 'your_text_domain'),
	'all_items' => __('All Front Page Gallery', 'your_text_domain'),
	'view_item' => __('View Front Page Gallery', 'your_text_domain'),
	'search_items' => __('Search Front Page Gallery', 'your_text_domain'),
	'not_found' =>  __('No Front Page Gallery found', 'your_text_domain'),
	'not_found_in_trash' => __('No Front Page Gallery found in Trash', 'your_text_domain'), 
	'parent_item_colon' => '',
	'menu_name' => __('Front Page Gallery', 'your_text_domain')
);
$args = array(
	'labels' => $labels,
	'public' => true,
	'publicly_queryable' => true,
	'show_ui' => true, 
	'show_in_menu' => true, 
	'query_var' => true,
	'rewrite' => array( 'slug' => _x( 'front-page-gallery', 'URL slug', 'your_text_domain' ) ),
	'capability_type' => 'post',
	'has_archive' => true, 
	'hierarchical' => false,
	'menu_position' => null,
	'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt','page-attributes' )
); 
register_post_type('frontpagegallery', $args);
function sd_meta_gallery($postid){
	global $frontpage_cloudcarousel;
	$meta = get_post_meta($postid, $frontpage_cloudcarousel->get_the_id(), TRUE);
	if( $meta ){
		return $meta;
	}else{
		return false;
	}
}
function sd_has_gallery($postid){
	return sd_meta_gallery($postid);
}
function sd_print_meta_gallery(){
	$gallery = wp_get_data_content('frontpagegallery');
	if( $gallery ){
		//print_r($gallery);
		require('view/frontpage-gallery.html');
	}
}
?>